/*
$(document).ready(function(){
  $("#startWork").click(function(){
    $("#result").load('start-work.php?case_id=' + document.getElementById("case_id").value);
  });
  
  $("#stopWork").click(function(){
    $("#result").load('stop-work.php');
  });

  $("#getCases").click(function(){
    $("#result").load('get-cases.php');
  });
  
});
*/

function loadTasks($num,$dom) {
	document.getElementById("tasks").innerHTML = "<img src='img/load.gif' alt='' /> &nbsp; Loading...<br /><br />";
	$url = 'get-cases.php?num=' + $num;
	$($dom).load($url);
}

function displayMessage($message) {
	document.getElementById("result").innerHTML = $message;
	setTimeout("resetMessage()",2000);
}

function resetMessage() {
	document.getElementById("result").innerHTML = "<p>Easily and quickly track time against your FogBugz cases.</p>";
}

function resolveCase($ix,$dom) {
	$url = 'resolve-case.php?ix=' + $ix;
	$($dom).load($url);
	document.getElementById("tasks").innerHTML = "<img src='img/load.gif' alt='' /> &nbsp; Loading...<br /><br />";
	setTimeout("loadTasks(15,'#tasks')",2000);
}
